//
// NeL - bindings
// Copyright (C) 2010 Naush
//
//This program is free software: you can redistribute it and/or modify
//it under the terms of the GNU Affero General Public License as
//published by the Free Software Foundation, either version 3 of the
//License, or (at your option) any later version.
//
//This program is distributed in the hope that it will be useful,
//but WITHOUT ANY WARRANTY; without even the implied warranty of
//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//GNU Affero General Public License for more details.
//
//You should have received a copy of the GNU Affero General Public License
//along with this program.  If not, see <http://www.gnu.org/licenses/>.

package org.ryzom.nel.misc;

public class CHashKey {
  private long swigCPtr;
  protected boolean swigCMemOwn;

  public CHashKey(long cPtr, boolean cMemoryOwn) {
    swigCMemOwn = cMemoryOwn;
    swigCPtr = cPtr;
  }

  public static long getCPtr(CHashKey obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }

  protected void finalize() {
    delete();
  }

  public synchronized void delete() {
    if (swigCPtr != 0) {
      if (swigCMemOwn) {
        swigCMemOwn = false;
        nelmiscJNI.delete_CHashKey(swigCPtr);
      }
      swigCPtr = 0;
    }
  }

  public CHashKey() {
    this(nelmiscJNI.new_CHashKey__SWIG_0(), true);
  }

  public CHashKey(SWIGTYPE_p_unsigned_char Message_Digest) {
    this(nelmiscJNI.new_CHashKey__SWIG_1(SWIGTYPE_p_unsigned_char.getCPtr(Message_Digest)), true);
  }

  public CHashKey(String str) {
    this(nelmiscJNI.new_CHashKey__SWIG_2(str), true);
  }

  public String toString_c() {
    return nelmiscJNI.CHashKey_toString_c(swigCPtr, this);
  }

  public void serial(IStream stream) {
    nelmiscJNI.CHashKey_serial(swigCPtr, this, IStream.getCPtr(stream), stream);
  }

  public boolean isEqual(CHashKey v) {
    return nelmiscJNI.CHashKey_isEqual(swigCPtr, this, CHashKey.getCPtr(v), v);
  }

  public void setHashKeyString(String value) {
    nelmiscJNI.CHashKey_HashKeyString_set(swigCPtr, this, value);
  }

  public String getHashKeyString() {
    return nelmiscJNI.CHashKey_HashKeyString_get(swigCPtr, this);
  }

}
